#include "SourceFactory.h"

SourceFactory::SourceFactory() {
}

SourceFactory::~SourceFactory() {
}

Element* SourceFactory::createElement( XMLElement * element) {
	return this->createSource(element);
}

Source * SourceFactory::createSource(XMLElement * sourceElement){
	
	Source* source = new Source();
	
	string id = FactoryUtil::getInstance()->buildId(sourceElement);
	Position *position = FactoryUtil::getInstance()->buildFrogPosition(sourceElement);
	float radius = FactoryUtil::getInstance()->buildFrogRadius(sourceElement);
	
	source->setId(id);
	source->setPosition(position);
	source->setRadius(radius);
	source->setElementColor(FactoryUtil::getInstance()->buildFrogBackgroundColor(sourceElement));
	source->setLineColor(FactoryUtil::getInstance()->buildFrogLineColor(sourceElement));
	source->setTexture(FactoryUtil::getInstance()->buildFrogTexture(sourceElement));

	return source;
}